home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1997 #1
/
Amiga Plus CD - 1997 - No. 01.iso
/
pd
/
programmierung
/
installproged
/
sasc_support
/
sources
/
getarguments.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-03-11
|
957b
|
49 lines
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/reqtools.h>
#include <libraries/reqtools.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct ReqToolsBase *ReqToolsBase;
void main(int argc,char *argv[])
{
BPTR file;
char buffer[500];
if (!(ReqToolsBase=(struct ReqToolsBase *)OpenLibrary(REQTOOLSNAME,REQTOOLSVERSION)))
{
printf("Can't open %s V%d\n",REQTOOLSNAME,REQTOOLSVERSION);
exit(0);
}
if (file=Open("PrjArguments",MODE_OLDFILE))
{
FGets(file,buffer,sizeof(buffer)-1);
if (buffer[0]) buffer[strlen(buffer)-1]='\0';
Close(file);
}
if (rtGetString(buffer,sizeof(buffer)-1,"Enter CLI arguments",NULL,
RTGS_AllowEmpty, TRUE,
TAG_END))
{
if (!(file=Open("PrjArguments",MODE_NEWFILE)))
{
CloseLibrary((struct Library *)ReqToolsBase);
exit(5);
}
Write(file,buffer,strlen(buffer));
Write(file,"\n",1);
Close(file);
}
CloseLibrary((struct Library *)ReqToolsBase);
exit(0);
}